home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
hardware
/
cpu115
/
cputype.doc
< prev
next >
Wrap
Text File
|
1995-02-27
|
15KB
|
309 lines
┌───────────┬──────────────────┬─────────────────────────────────────────────┐
│╔════════╗ │File: CPUTYPE.DOC │Subject: CPU/FPU feature detection library. │
│╠════════╩╗├───────────────┬──┴─────────────────────────────────────────────┤
│║╓─╓─╥─╥╖ ║│Date: 27/02/95 │ Copyright(c) 1992-95 by B-coolWare. │
│║╙─╨─╨─╜╙─║│Version: 1.15 │ This document should not be changed in any way │
│╚═════════╝│Revision:04/01 │and should be distributed with related software.│
└───────────┴───────────────┴────────────────────────────────────────────────┘
Document no.: LR-0006.93.95M04.01
"...Too much is not enough."
(Deep Purple)
Contents
License Agreement.
Appendix A. Library Features and Notes.
Appendix B. Credits.
Appendix C. Known incompatibilities.
Appendix D. Files in distribution.
Too-Much-In-One-So-Don't-Get-Lost(tm) CPU/FPU feature detection library
License.
This license regards to the Too-Much-In-One-So-Don't-Get-Lost(tm) CPU/FPU
detection library version 1.15 dated 27/02/95, mentioned hereafter as
"source code". It describes your rights, obligations and liabilities as for
this source code. It took much time to gather all information used to
produce this code, so the main purpose of this license is to grant anyone
free access to it. Use it free, give away to anyone, but please do not
sell or lease it - it's my work, and if you think someone should be paid
for it, you're not the rite person anyway.
Here it goes:
SOFTWARE STATUS AND COPYRIGHT:
This source code is free copyrighted software. This means that author reserves
copyright for this code. This doesn't mean however that you cannot use,
distribute or modify the code. This just means that you cannot reserve
copyright for this code or charge money for it. However you may reserve
copyright for any changes/additions you made to it. See details hereafter.
YOUR RIGHTS AND LIABILITIES:
You have legal rights to copy, distribute, modify and use entire code or parts
of it in either commercial or noncommercial software, provided that you do
not charge additional fee for distribution/incorporation of this code or its
parts in your own products. If you do so, your rights automatically void and
you'll be liable for violation of the Russian Copyright Law in Computer
Programs and Databases as well as other laws and international provisions
regarding to intellectual property and copyrights. Parties that acquire this
source code from you will still have their rights for the source code as
long as they comply with terms of this license.
YOUR OBLIGATIONS:
The source code SHOULD be distributed along with this license and you should
document any changes made to it either in source files or in additional
documents. The code cannot be distributed partially, you should include all
files that builds the library plus any additional files needed to compile it
in the distribution archive/set. Regardless of the extent of modifications
made by you to this source code, it should remain free, and you should
provide a way for anyone (and partially the author :) to obtain his own copy
as of original, so as of modified code. Although you can reserve copyright
for modifications, the rest of the code will still be copyrighted by
B-coolWare and you should keep the B-coolWare's copyright notice in the code
unchanged.
WARRANTIES:
This source code is provided "AS IS" with no express or implied warranties,
including any implied warranties of fitness for particular purpose. Author
can only guarantee that the code will occupy your disk space. If you modify
the source code included herein, please add a notification about it and
complete description of what and how you modified, so that subsequent users
of this code will know that they use not original but rather modified
version of the code.
AUTHOR'S LIABILITY:
In case of any damage caused by use or misuse of this code or any other kind
of decease including loss of business profits or valuable information,
author shall not be liable for it. I expressly disclaim any warranties
regarding to the quality of this code, or its errorlessness.
AUTHOR'S EXCLUSIVE RIGHTS:
Author reserves the right to change this code entirely or partially without
notification to its users. He also reserves the right to use this code in
any manner in any commercial or non-commercial software of any kind and
give it away to anyone who ask. And he also reserves the right to change
software legal status (to shareware, for example) as he sees fit.
If you have any questions, suggestions or usable information on how to
improve this product, feel free to contact author at
e-mail (preferrable):
2:5028/52.6@fidonet
bob@ymz.yaroslavl.su (Relcom@Internet) (starting in March 1995)
do ye think me should arrive on CompuServe? :)
Internet users can also try to reach me at cnit.uniyar.ac.ru: send message to
root@cnit.uniyar.ac.ru or xor@cnit.uniyar.ac.ru and ask to forward it to me.
phones:
+7-(0852)-274-551 (9:00am to 6:00pm, Moscow Time) voice\data 14400/V.32b\fax
+7-(0852)-238-663 (8:00pm to 10:00pm,Moscow Time) voice
please don't call earlier or later - gimme a break...
paper mail:
150031, 10/4/13,
Dobrynina Str.,
Yaroslavl,
Russia
Vladimir M. Zakharychev (é½áñ¿¼¿α çáσáαδτÑó) aka Bobby Z.
Calls and letters both in English and in Russian are welcome. Please do not
speak/write in any other language if you want to be answered. Letter bombs
will be returned to sender :) shhhh-boom-BANG!
Huh...! Hope I made every effort to keep the lawyers happy... :)
Appendix A. Library Features and Notes.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Too-Much-In-One-So-Don't-Get-Lost(tm) CPU/FPU feature detection library
allows you to distinguish between following 80x86 family CPUs:
Intel 8088,8086,80188,80186,80286,80386DX,80386SX,i486DX,i486SX,Pentium,
P24D (Pentium Overdrive) and any succeeding CPUs (when they become available),
NEC V20 and V30,
AMD Am386SX-40 and Am386DX-40, K5 when it become available,
Cyrix 486SLC, 486SX/DX/DLC and M1 (586),
on newer 486s also tries to determine SX/DX/DX2/SL/DX4/Overdrive model,
UMC U5-S, U5-D (486s) (??? is U5-D real thing?)
FPUs:
Intel 8087,80287,80287XL - not 100% reliable,80387,i487sx and 487 internal,
Cyrix 2C87,3C87 and 4C87,
IIT 2C87 and 3C87,
Weitek 1167 and 1367, both reported simply as Weitek;
determine whether or not the processor is in V86 mode (for DOS programs only)-
generally this one just tests for PM flag and assumes V86 if it is set for DOS
+ PM combination automatically leads to V86;
determine 386dx chip step (B0 or earlier,B1,D0 or later) -
this one tests for known bugs in chips of these steps, it does not reset CPU
to look at EAX value; doesn't work under Windows;
determine CPU clock speed (for all listed processors, was not checked on some
models and may require some adjustments). Works fine under _my_ Windows, but
some people stated it produced incorrect results on their systems;
determine 386 and 486 chip model for Intel/AMD chips when ran in real mode.
Notes.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note 1:
The source code is commented so I didn't include its description here. I think
there'll be no problem using it. I also included samples in Turbo Pascal and
Turbo C, which may be incorporated into your hi-level programs. Lotta probs
vanished, heh :)
Note 2:
I have no access to Cyrix M1 machines and thus can't check and fix CPU timings
in CPUSPEED.ASM for this processor. This may lead to inadequate MHz
reported. If anyone have time and access to an M1-based machine I'd like
you to check this and fix CPUFix value if needed. And don't forget to contact
me and send me adjusted value so I'll be able to fix it by myself! Also
please check if M1 is correctly identified - I'm not quite sure it will.
Note 3:
Take a look at the batches I provided to simplify compile process and
correct paths and parameters where needed before running them. This is
especially true for MAKEC.BAT and MLIB.BAT, for they contain paths I used on
my PC to compile C version of code. The same modifications required for
MAKEFILE.
Appendix B. Credits.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This appendix contains names and netmail addresses of people who contributed
to this product in any way, either by adding any methods or by fixing
existing methods given incorrect results. If you do such additions or fixes,
please contact me and send modified version of the code so that I'll be able
to incorporate it in next releases.
My thanx to
1. Igor Dral of 2:50/321@fidonet
who helped me lot in cleaning the code of bugs, testing, etc. Thanx, pal!
2. VAP of 2:5028/52.6@fidonet (he's my BOSS),
who helped me with C code - I don't like this language myself :)
3. Alex B. Shamarokov of 2:5020/205.8@fidonet
who awared me of strange behavior of the code on new Intel' chips with
CPUID support, so I did an attempt to fix it in v1.14c.
4. Janis Smits of 2:5100/25@fidonet
who awared me of OS/2 problems and pointed out the origin of them, and
provided 486 model codes returned by CPUID.
5. Ilya Tumanov of 2:5030/82.6@fidonet
who advised me to add integer CPU MHz calculations for those who want only
rough approximation of clock speed and provided 386/486 model retriever.
6. Igor Krasikov of 2:463/59@fidonet
who first among others told me how to detect OS/2 reliably (I should read
Ralf's IntList more thoroughly...) and made some other bugfixing.
7. Aleksandr Konosevich of 2:5004/9.7@fidonet
for shorter Cyrix CPU detection code. He also develops further Cyrix CPU
distinguishing now.
8. Sergei Frolov of 2:5030/219.9@fidonet
for P24D distinguishing code.
9. YOUR NAME MIGHT BE HERE...
And, of course, thanks to Almighty God for the inspiration and everything,
and all of you, who paid attention to this product, spent your invaluable
time testing it and maybe even made use of it!
Appendix C. Known incompatibilities.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Under Soft-Ice 2.62 and below incorrectly states 386DX to be 386SX. This
is because Soft-Ice's V86 monitor do not allow to toggle ANY flags in
CR0 from V86 task. All other CPU identifiers does just such a mistake
under Soft-Ice. Let's hope Nu-Mega will fix their monitor in future
versions of this nice debugger so we'll be able to get correct results. :)
The same thing happens in Borland Pascal protected mode applications due
to Borland's DPMI host but under it 486SX/DX detection doesn't work.
2. Under Windows 3.1 386 chip stepping determination routine crashes DOS
session due to "invalid instruction". This is due to Windows exception
handler implementation: it doesn't reflect exception 6 to real mode
interrupt handler. The fix is: do not invoke this routine under Windows.
3. People say that under OS/2 clock frequency gets divided by 2. I didn't
find a workaround yet. Those who can't wait may try this: use isInOSZwei
routine to determine if we're under OS/2 and multiply clock frequency by
2 (shl 1) if so. This is very rough approach though and I hope to find
more elegant way to solve the problem. I tried to find a "begin/end criti-
cal section" call to OS/2's DOS CompBox API and failed. If anyone knows of
correct and reliable way to enter/leave critical section under OS/2 please
let me know (but seems there's no such call...).
Btw, under _my_ OS/2 V3 clock speed is computed correctly... And I'm NOT
using TAME... No, that doesn't mean this is the origin of the problem, I'm
just guessing. Remember that?: "Blinker, what are ye doin' there? -
Guessing... I guess no one coming..." and later: "I CAN SEE!!! (CRASH!
BANG!) Nope. I was wrong... :(" :))
4. Protected mode applications made in Borland Pascal 7.0 using Borland's
DPMI host may terminate with Runtime Error 216 (General Protection Fault)
if ran from real mode or under some older memory managers. This is due to
DPMI host implementation: it does not allow to read or write to CR?
registers from PL other than 0. Normally, most of memory managers and
DOS Extenders intercept exception 13 and performs offending instructions
on ring 0 returning results to application issued invalid instruction, but
DPMI16BI doesn't. The only possible workaround is to kick some asses in
Borland and make 'em fix their host. :)
Appendix D. Files in distribution.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Original issue of the source code as of version 1.15 include:
File Description
------------ ----------------------------------------------------------
CPU_TYPE.ASH Main library module for ASM programs.
DOSINOUT.ASH DOS Input/Output routines.
LSTRING.ASH Lstring macro to define Pascal-style length,data strings.
HEADER.ASH Assembly language header file - memory model definition, etc.
UNIDEF.INC Assembly language macros.
CPU.ASM Sample program demonstrating usage of CPU_TYPE.ASH.
CPUSPEED.ASM CPU clock speed determination routine.
CPU_HL.ASM Main library module for use with hi-level languages.
CPU.C Sample program in C.
CPUTYPE.C C library implementation.
CPUTYPE.H C library interface.
CPU.PAS Sample program in Pascal.
CPUTYPE.PAS Pascal library interface & implementation.
P5INFO.ASM Low level routines for P5INFO.C and P5INFO.PAS.
P5INFO.C Sample program providing basic info on P5 in C.
P5INFO.PAS Sample program providing basic info on P5 in Pascal.
MAKEA.BAT Make batch for assembly-language version.
MAKEP.BAT Make batch for pascal version.
MAKEC.BAT Make batch for C version.
MLIB.BAT Make batch to build C/C++ .lib library file.
YESNO.COM Batch service program, displays prompt and waits for Y/N.
README.1ST Readme file. You should already been read it...
SMM.ASM SMM test routine.
MODEL486.ASM Routine to get chip model/submodel code.
TEST486.PAS Sample program making use of MODEL486.ASM.
HISTORY.DOC History of changes.
<< end of CPUTYPE.DOC >>